package com.jeesite.modules.ocr.config;

import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import com.jeesite.modules.swagger.config.SwaggerConfig;

import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.spring.web.plugins.Docket;

@Configuration
@ConditionalOnProperty(name = "web.swagger.enabled", havingValue = "true", matchIfMissing = false)
public class OcrCustomApiConfig {

	@Bean
	@ConditionalOnProperty(name = "web.swagger.custom.enabled", havingValue = "true", matchIfMissing = true)
	public Docket customApi() {
		String moduleCode = "100-orcModel";
		String moduleName = "OCR 光识别通用接口";
		String basePackage = "com.jeesite.modules.ocr.front";
		return SwaggerConfig.docket(moduleCode, moduleName, basePackage).select().apis(
//						Predicates.and(Predicates.and(
//						RequestHandlerSelectors.withClassAnnotation(Api.class),
//						RequestHandlerSelectors.withMethodAnnotation(ResponseBody.class)),
//						RequestHandlerSelectors.basePackage(basePackage))
				RequestHandlerSelectors.basePackage(basePackage)).build();
	}

}
